<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:fmt="http://java.sun.com/jstl/fmt"
    xmlns:rich="http://richfaces.org/rich">

<div class="grid-3-12">
							<h:panelGroup id="pgFuncaoExerce" >
								<h:outputLabel  id="lbFuncaoExerce"  class="form-lbl"  value="Função(ões) que Exerce:"/>
								<h:selectOneMenu converter="indexConverter"  id="cbFuncoesExerce"  value="#{membroCadastro.funcaoExerce}">
										<f:selectItem itemLabel="Selecione..." itemValue=""/>
									   <t:selectItems value="#{membroCadastro.listaFuncao}" var="funcao" itemLabel="#{funcao.noFuncao}" itemValue="#{funcao}"/>
								</h:selectOneMenu>	
							</h:panelGroup>				
						</div>
						
						<div style="padding-top: 28px" class="grid-1-12">
							<a4j:commandLink  id="cbaddFuncaoExerce"  ajaxSingle="true" process="cbFuncoesExerce" reRender="panel,pgMsgFuncaoExerce" action="#{membroCadastro.adicioarFuncaoExerce}" >
								<h:graphicImage value="/resources/imagens/btn_adicionar.png" id="giAddFuncaoExerce" styleClass="hidelink"/>
							</a4j:commandLink>
						</div>
						<div class="grid-4-12" style="padding-top: 28px" id="dvMensagenFuncExerce">
							<h:panelGroup id="pgMsgFuncaoExerce">
								  <h:messages rendered="#{membroCadastro.exibirMensagem}" for="cbaddFuncaoExerce" id="msFuncaoExerce" style="color : red" />
							</h:panelGroup>
						</div>
						<div class="field-clear"></div>
						<div class="grid-3-12">
							 <a4j:outputPanel id="panel" ajaxRendered="true"> 
								 <rich:dataGrid style="width: 400px" 
								 rowClasses="odd, even" 
	                    			styleClass="dataTable rich-table rich-table-cell ui-widget-content ui-grid-content"
								 id="tbFuncaoExerce" columns="#{membroCadastro.qtFuncaoExerce}"  
								 var="funcaoExerce" value="#{membroCadastro.listaFuncaoExerce}" >
								  <h:panelGrid columns="2">
								  		<h:column >
											<h:outputText value="#{funcaoExerce.noFuncao}" />
										</h:column>
										<h:column>
										<a4j:commandLink ajaxSingle="true" action="#{membroCadastro.removerFuncaoExerce}" reRender="tbFuncaoExerce"  >
											 <f:setPropertyActionListener target="#{membroCadastro.funcao}" value="#{funcaoExerce}"/> 
											 <h:graphicImage value="/resources/imagens/btn_excluir.png" id="giAdd" styleClass="hidelink"/> 
										</a4j:commandLink>
										</h:column>
									</h:panelGrid>
								</rich:dataGrid> 
							</a4j:outputPanel>
						</div>
						<div class="field-clear"></div>
						<div class="grid-3-12"> 
						<h:panelGroup id="pgFuncaoPrentendida" >
							<h:outputLabel  id="lbFuncaoPretendida"  class="form-lbl"  value="Função(ões)  Prentendida(s):"/>
							<h:selectOneMenu converter="indexConverter"   id="cbFuncoesPretendida"  value="#{membroCadastro.funcaoPretendida}">
									<f:selectItem itemLabel="Selecione..." itemValue=""/>
								   <t:selectItems value="#{membroCadastro.listaFuncao}" var="funcao" itemLabel="#{funcao.noFuncao}" itemValue="#{funcao}"/>
							</h:selectOneMenu>	
							</h:panelGroup>				
						</div>
						
						<div class="grid-1-12" style="padding-top: 28px">
							<a4j:commandLink  id="cbaddFuncaoPretendida" ajaxSingle="true" process="cbFuncoesPretendida" reRender="tbFuncaoPretendida,pgMsgFuncaoPretendida" action="#{membroCadastro.adicioarFuncaoPretendida}" >
								<h:graphicImage value="/resources/imagens/btn_adicionar.png" id="giAdd" styleClass="hidelink"/>
							</a4j:commandLink>
						</div>
						<div class="grid-5-12" style="padding-top: 28px" id="dvMensagenFuncPretendida">
							<h:panelGroup id="pgMsgFuncaoPretendida">
								  <h:messages rendered="#{membroCadastro.exibirMensagem}" for="cbaddFuncaoPretendida" id="msFuncaoPretendida" style="color : red" />
							</h:panelGroup>
						</div>
						<div class="field-clear"></div>
						<div class="grid-3-12">
							 <a4j:outputPanel id="panelFuncaoPretendida" ajaxRendered="true"> 
								 <rich:dataGrid style="width: 400px; border:1px" id="tbFuncaoPretendida" 
								 columns="#{membroCadastro.qtFuncaoPretendida}"  var="funcaoPretendida"
								  rowClasses="odd, even" 
	                    			styleClass="dataTable rich-table rich-table-cell ui-widget-content ui-grid-content"
								  value="#{membroCadastro.listaFuncaoPretendida}" >
								  <h:panelGrid columns="2">
								  		<h:column >
											<h:outputText value="#{funcaoPretendida.noFuncao}" />
										</h:column>
										<h:column>
										<a4j:commandLink id="removerFuncPretendida" ajaxSingle="true"  action="#{membroCadastro.removerFuncaoPretendida}" reRender="tbFuncaoPretendida"  >
											 <f:setPropertyActionListener target="#{membroCadastro.funcao}" value="#{funcaoPretendida}"/> 
											  <h:graphicImage value="/resources/imagens/btn_excluir.png" id="giAdd" styleClass="hidelink"/> 
										</a4j:commandLink>
										</h:column>
									</h:panelGrid>
								</rich:dataGrid> 
							</a4j:outputPanel>
						</div>
</ui:composition>
